﻿using System;
using System.Reflection;
using System.Runtime.InteropServices.Expando;
using System.Runtime.InteropServices.ComTypes;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Imaging;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Net;
using System.Linq;
using System.Text;
using BrainTechLLC.ImageOperatorsNonAForgeDependent;
using BrainTechLLC;
using System.Configuration;
using System.Diagnostics;
using BrainTechLLC.ThreadSafeObjects;

namespace BrainTechLLC.WebCamLib3
{
    // todo - finish this sucker - not complete
    public class WatchableFrameInfo : BaseNotifyPropertyChanged
    {
        public WatchableFrameInfo(FrameInfo frameInfo)
        {
            this._bitmap = frameInfo.Bitmap;
            this._cameraMoniker = frameInfo.CameraMoniker;
            this._cameraName = frameInfo.CameraName;
            this._height = frameInfo.Height;
            this._width = frameInfo.Width;
            this._imageFrameTime = frameInfo.ImageFrameTime;
        }

        public WatchableFrameInfo()
        {
        }

        public Bitmap Bitmap
        {
            get { return _bitmap; }
            set
            {
                if (_bitmap != value)
                {
                    _bitmap = value;
                    OnPropertyChanged("Bitmap");
                }
            }
        }
        public int Width
        {
            get { return _width; }
            set
            {
                if (_width != value)
                {
                    _width = value;
                    OnPropertyChanged("Width");
                }
            }
        }
        public int Height
        {
            get { return _height; }
            set
            {
                if (_height != value)
                {
                    _height = value;
                    OnPropertyChanged("Height");
                }
            }
        }
        public string CameraName
        {
            get { return _cameraName; }
            set
            {
                if (_cameraName != value)
                {
                    _cameraName = value;
                    OnPropertyChanged("CameraName");
                }
            }
        }
        public string CameraMoniker
        {
            get { return _cameraMoniker; }
            set
            {
                if (_cameraMoniker != value)
                {
                    _cameraMoniker = value;
                    OnPropertyChanged("CameraMoniker");
                }
            }
        }
        public double ImageFrameTime
        {
            get { return _imageFrameTime; }
            set
            {
                if (_imageFrameTime != value)
                {
                    _imageFrameTime = value;
                    OnPropertyChanged("ImageFrameTime");
                }
            }
        }

        public PixelFormat PixelFormat
        {
            get { return _pixelFormat; }
            set
            {
                if (_pixelFormat != value)
                {
                    _pixelFormat = value;
                    OnPropertyChanged("PixelFormat");
                }
            }
        }

        protected PixelFormat _pixelFormat;
        protected Bitmap _bitmap;
        protected int _width;
        protected int _height;
        protected string _cameraName;
        protected string _cameraMoniker;
        protected double _imageFrameTime;
    }
}
